package br.com.OnFit.jdbc;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class ConectaBanco {

	public static Connection getConexao() {
	
		Connection con = null;
		String url = "jdbc:mysql://localhost/ONFIT";
		String user = "root";
		String pass = "root";
		
		
		try 	{
			
				try {
					Class.forName("com.mysql.jdbc.Driver");
					System.out.println("Driver ta beleza");	
					} 
						
				catch (ClassNotFoundException e) {
				System.out.println("Driver nao encontrado");
												}  
			con = DriverManager.getConnection(url, user, pass);
			System.out.println("Rolou a conexao brow");
				
		} 
		
		catch (SQLException e) {
			System.out.println("Nao Conectou" + e.getMessage()); 
											} 
		return con;
	
	}
}

